/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entidades;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Ruben
 */
@Entity
@Table(name = "token", catalog = "iluscode", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Token.findAll", query = "SELECT t FROM Token t"),
    @NamedQuery(name = "Token.findByIdToken", query = "SELECT t FROM Token t WHERE t.idToken = :idToken"),
    @NamedQuery(name = "Token.findByTipoToken", query = "SELECT t FROM Token t WHERE t.tipoToken = :tipoToken"),
    @NamedQuery(name = "Token.findByValor", query = "SELECT t FROM Token t WHERE t.valor = :valor")})
public class Token implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "idToken", nullable = false)
    private Integer idToken;
    @Size(max = 45)
    @Column(name = "tipoToken", length = 45)
    private String tipoToken;
    @Size(max = 45)
    @Column(name = "valor", length = 45)
    private String valor;

    public Token() {
    }

    public Token(Integer idToken) {
        this.idToken = idToken;
    }

    public Integer getIdToken() {
        return idToken;
    }

    public void setIdToken(Integer idToken) {
        this.idToken = idToken;
    }

    public String getTipoToken() {
        return tipoToken;
    }

    public void setTipoToken(String tipoToken) {
        this.tipoToken = tipoToken;
    }

    public String getValor() {
        return valor;
    }

    public void setValor(String valor) {
        this.valor = valor;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idToken != null ? idToken.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Token)) {
            return false;
        }
        Token other = (Token) object;
        if ((this.idToken == null && other.idToken != null) || (this.idToken != null && !this.idToken.equals(other.idToken))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Token[ idToken=" + idToken + " ]";
    }
    
}
